Distinguish ioemu handled devices and para virtualized devices
authoradsharma@los-vmm.sc.intel.com <adsharma@los-vmm.sc.intel.com>
Mon, 15 Aug 2005 20:50:32 +0000 (12:50 -0800)
committeradsharma@los-vmm.sc.intel.com <adsharma@los-vmm.sc.intel.com>
Mon, 15 Aug 2005 20:50:32 +0000 (12:50 -0800)
Signed-off-by: Xiaofeng Ling <xiaofeng.ling@intel.com>
Signed-off-by: Arun Sharma <arun.sharma@intel.com>
tools/examples/xmexample.vmx
tools/python/xen/xend/XendDomainInfo.py
tools/python/xen/xend/image.py
tools/python/xen/xend/server/blkif.py

index 95616cda619287d13afddc144638d4289bfc9350..77662fcca946d05121bbd62900307bc2c68dda4b 100644 (file)
@@ -34,7 +34,7 @@ name = "ExampleVMXDomain"
 # and MODE is r for read-only, w for read-write.
 
 #disk = [ 'phy:hda1,hda1,r' ]
-disk = [ 'file:/var/images/min-el3-i386.img,hda,w' ]
+disk = [ 'file:/var/images/min-el3-i386.img,ioemu:hda,w' ]
 
 #----------------------------------------------------------------------------
 # Set according to whether you want the domain restarted when it exits.
index 5fe20c499a64e1313222fa41b888ce3c0e26b34e..f11c622981bd2b16cbf93c6d58c8d775cf90c53d 100644 (file)
@@ -743,8 +743,7 @@ class XendDomainInfo:
             for ctrl in self.getDeviceControllers():
                 ctrl.initController(reboot=True)
         else:
-           if self.image.ostype != 'vmx':
-                self.create_configured_devices()
+            self.create_configured_devices()
         if not self.device_model_pid:
             self.device_model_pid = self.image.createDeviceModel()
 
@@ -916,8 +915,7 @@ class XendDomainInfo:
         """
         self.configure_fields()
         self.create_devices()
-       if self.image.ostype != 'vmx':
-            self.create_blkif()
+        self.create_blkif()
 
     def create_blkif(self):
         """Create the block device interface (blkif) for the vm.
index afa6d1da990155f92bf148c25441cd4da6084a3d..ebf1b2009abfe543501e35e4614468cff473b9ce 100644 (file)
@@ -16,6 +16,7 @@
 #============================================================================
 
 import os, string
+import re
 
 import xen.lowlevel.xc; xc = xen.lowlevel.xc.new()
 from xen.xend import sxp
@@ -329,8 +330,15 @@ class VmxImageHandler(ImageHandler):
             if name == 'vbd':
                vbdinfo = sxp.child(device, 'vbd')
                uname = sxp.child_value(vbdinfo, 'uname')
-               vbddev = sxp.child_value(vbdinfo, 'dev')
+               typedev = sxp.child_value(vbdinfo, 'dev')
                (vbdtype, vbdparam) = string.split(uname, ':', 1)
+               if re.match('^ioemu:', typedev):
+                  (emtype, vbddev) = string.split(typedev, ':', 1)
+               else:
+                  emtype = 'vbd'
+                  vbddev = typedev
+               if emtype != 'ioemu':
+                  continue;
                vbddev_list = ['hda', 'hdb', 'hdc', 'hdd']
                if vbddev not in vbddev_list:
                   raise VmError("vmx: for qemu vbd type=file&dev=hda~hdd")
index 5bd89e8353c22a3278cf3e9770c88ad1b711f3d2..49d1fc5f9e64e83605cf39140a78550911c60b92 100755 (executable)
@@ -18,6 +18,7 @@
 """Support for virtual block devices.
 """
 import string
+import re
 
 from xen.util import blkif
 from xen.xend.XendError import XendError, VmError
@@ -199,6 +200,7 @@ class BlkDev(Dev):
         self.vdev = None
         self.mode = None
         self.type = None
+        self.emtype = None
         self.params = None
         self.node = None
         self.device = None
@@ -237,7 +239,12 @@ class BlkDev(Dev):
         # Split into type and type-specific params (which are passed to the
         # type-specific control script).
         (self.type, self.params) = string.split(self.uname, ':', 1)
-        self.dev = sxp.child_value(config, 'dev')
+        typedev = sxp.child_value(config, 'dev')
+        if re.match( '^ioemu:', typedev):
+            (self.emtype, self.dev) = string.split(typedev, ':', 1)
+        else:
+            self.emtype = 'vbd'
+            self.dev = typedev
         if not self.dev:
             raise VmError('vbd: Missing dev')
         self.mode = sxp.child_value(config, 'mode', 'r')
@@ -258,6 +265,8 @@ class BlkDev(Dev):
         if recreate:
             pass
         else:
+            if self.emtype == 'ioemu':
+                return
             node = Blkctl.block('bind', self.type, self.params)
             self.setNode(node)
             self.attachBackend()